# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-mercenary
_gemname=mercenary
pkgver=0.4.0
pkgrel=4
pkgdesc="An easier way to build your command-line scripts in Ruby"
url="https://github.com/jekyll/mercenary"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-rspec"
source="https://github.com/jekyll/mercenary/archive/v$pkgver/$_gemname-$pkgver.tar.gz
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	rspec .
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions
}

sha512sums="
8399887c3a24daa9329a69dc99804934a30f5b91b6742698a048db7810448b12479a0761a7dc12f63db813da81251482394d1d30a2535710f96285b96dc5a4ac  mercenary-0.4.0.tar.gz
17ef404b844ed3cad61b1b3be8b1e7897c1bdd9946d382dc368f6a7d13470dc1b355105e03e271d29e0d0586f03878bb4d50c28edd0dba2e58aac0aa1ecc3da1  gemspec.patch
"
